package com.zxt.lock.config;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.weaver.Advice;
import org.aspectj.weaver.AnnotatedElement;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/*
@Configuration
@ConditionalOnClass({EnableAspectJAutoProxy.class, Aspect.class, Advice.class, AnnotatedElement.class})
@ConditionalOnProperty(prefix = "spring.aop", name = "auto", havingValue = "true", matchIfMissing = true)
public class AopAutoConfiguration {
    @Configuration
    @EnableAspectJAutoProxy(proxyTargetClass = false)
    //看配置文件，假如配置的spring.aop.proxy-target-class为false则引入JdkDynamicAutoProxyConfiguration
    @ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target -class", havingValue = "false",
            matchIfMissing = false)
    public static class JdkDynamicAutoProxyConfiguration {

    }

    @Configuration
    //开启AspectJAutoProxy
    @EnableAspectJAutoProxy(proxyTargetClass = true)
    //看配置文件，假如配置的spring.aop.proxy-target-class为true则引入CglibAutoProxyConfiguration
    @ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target -class", havingValue = "true",
            matchIfMissing = true)
    public static class CglibAutoProxyConfiguration {
    }
}*/
